/*
 ============================================================================
 Name		: MyGoodsListboxItem.h
 Author	  : 
 Version	 : 1.0
 Copyright   :
 Description : MyGoodsListboxItem declaration
 ============================================================================
 */

#ifndef MyGoodsListboxItem_H
#define MyGoodsListboxItem_H

// INCLUDES
#include <e32std.h>
#include <e32base.h>
#include "fFramework.h"
#include "YuebaoShoppingGoods.h"
#include "fListbox.h"
#include "YuebaoBuffer.h"
#include "YuebaoSplashString.h"

// CLASS DECLARATION

/**
 *  MyGoodsListboxItem
 *
 */
class MyGoodsListboxItem : public fListBoxItem
{
public:
    // Constructors and destructor

    /**
     * Destructor.
     */
    ~MyGoodsListboxItem( );

    /**
     * Two-phased constructor.
     */
    static MyGoodsListboxItem* NewL( fEngine* aFramework, YuebaoShoppingGoods* goods );

    /**
     * Two-phased constructor.
     */
    static MyGoodsListboxItem* NewLC( fEngine* aFramework, YuebaoShoppingGoods* goods );

private:

    /**
     * Constructor for performing 1st stage construction
     */
    MyGoodsListboxItem( );

    /**
     * EPOC default constructor for performing 2nd stage construction
     */
    void ConstructL( fEngine* aFramework, YuebaoShoppingGoods* goods );
public:
    void RenderFrame( );
public:
    void DrawHilite( );
public:
    YuebaoShoppingGoods* _goods;
protected:
    void DrawItem( bool hilite, int x, int y );
protected:
    DrawableString _goodsName;
protected:
    int DrawNormal( int x, int y )
    {
        DrawItem( false, x, y );
        return 0;
    }
    int DrawHilite( int x, int y )
    {
        DrawItem( true, x, y );
        return 0;
    }
protected:
    CFont* _font;
    CFont* _small_font;
    bool _layouted;
public:
    int ItemHeight( );
protected:
    YuebaoBuffer< 64 > _price;
    YuebaoBuffer< 64 > _total;

    // fImage* _curseIcon;
};

#endif // MyGoodsListboxItem_H
